let geoGfx = require('geoGfxBase');

let GfxGlowing = cc.Class({

    extends: geoGfx,

    _getShaderName(){
        return 'geoGlowing';
    },

    properties: {
        glowingColor:{
            default:cc.Color.YELLOW,
            tooltip:'发光颜色'
        },
        glowingRadius:{
            default:4,
            tooltip:'发光厚度（像素）'
        },
    },

    updateMat(dt){
        var size = this.sprite.spriteFrame.getTexture();

        this.setMaterialParams({
            iResolution: new cc.Vec3(size.width, size.height, 0),
            iRadius: this.glowingRadius,
            iGlowingColor: this._colorToQuat(this.glowingColor),
        });
    },

    _preApplyShader(){
    },
    _postApplyShader(){
        this.updateMat();
    },
    _postUnapplyShader(){
    },
});

module.exports = GfxGlowing;